import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/Login'
import Welcome from '@/views/Welcome'
import Users from '@/views/Layout/Users'
import Roles from '@/views/Layout/Roles'
import Rights from '@/views/Layout/Rights'
import Goods from '@/views/Layout/Goods'
import Params from '@/views/Layout/Params'
import Categories from '@/views/Layout/Categories'
import Orders from '@/views/Layout/Orders'
import Reports from '@/views/Layout/Reports'
import FrontPage from '@/views/Layout/FrontPage'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/layout',
    component: Welcome,
    redirect: '/welcome',
    children: [
      {
        path: '/welcome',
        component: FrontPage
      },
      {
        path: '/userlist',
        component: Users
      }, {
        path: '/roles',
        component: Roles
      }, {
        path: '/roles',
        component: Roles
      }, {
        path: '/rights',
        component: Rights
      }, {
        path: '/goods',
        component: Goods
      }, {
        path: '/params',
        component: Params
      }, {
        path: '/categories',
        component: Categories
      }, {
        path: '/orders',
        component: Orders
      }, {
        path: '/reports',
        component: Reports
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
